package com.bwie.gddproject.index.precenter;

import com.bwie.gddproject.index.model.IVpModel;
import com.bwie.gddproject.index.model.bean.VpBean;
import com.bwie.gddproject.index.model.VpModel;
import com.bwie.gddproject.index.view.fragment.IGridFragment;
import com.bwie.gddproject.net.OnNetLitenner;

/**
 * Created by 我走路带风 on 2017/12/15.
 */

public class VpPrecenter implements IVpPrecenter {
    private IVpModel vpModel;
    private IGridFragment gridFragment;

    public VpPrecenter(IGridFragment gridFragment) {
        vpModel = new VpModel();
        this.gridFragment = gridFragment;
    }

    @Override
    public void getVpData() {
        vpModel.getVpData(new OnNetLitenner<VpBean>() {
            @Override
            public void success(VpBean vpBean) {
                gridFragment.showVpFrag(vpBean);
            }

            @Override
            public void fail(String errer) {
                gridFragment.toast(errer);
            }
        });
    }
}
